package com.changpay.zywy.mvp.presenter

import com.changpay.zywy.base.BasePresenter
import com.changpay.zywy.ext.ss
import com.changpay.zywy.mvp.contract.ForgetPasswordContract
import com.changpay.zywy.mvp.model.ForgetModel


/**
 * Created by chenxz on 2018/5/27.
 */
class ForgetPresenter : BasePresenter<ForgetPasswordContract.Model, ForgetPasswordContract.View>(), ForgetPasswordContract.Presenter {
    override fun revisePassword(phone: String, code: String, password: String, comfitPassword: String) {
        mModel?.revisePassword(phone,code,password,comfitPassword)?.ss(mModel,mView){
            mView?.reviseSuccess()
        }
    }

    override fun getCode(phone: String, type: String) {
        mModel?.getCode(phone,type)?.ss(mModel,mView){
            mView?.getSuccess(data = it.result)
        }
    }

    override fun createModel(): ForgetPasswordContract.Model? = ForgetModel()

}